const router = require('koa-router')();
const shopController = require('../controllers/Shop');

router.prefix('/shop'); //加默认前缀

//首页
router.get('/', shopController.getIndexPage);
router.get('/api/index-data', shopController.getIndexData);
//详情页
router.get('/product-detail/:pid', shopController.getDetailPage);



module.exports = router;


// router.get('/string', async (ctx, next) => {
//   ctx.body = 'koa2 string'
// })

// router.get('/json', async (ctx, next) => {
//   ctx.body = {
//     title: 'koa2 json'
//   }
// })